package com.newsystem.controller;


import com.newsystem.MyUtils.CommonResult;
import com.newsystem.MyUtils.MyUUIDUtils;
import com.newsystem.mapper.TGoodMapper;
import com.newsystem.pojo.TGood;
import com.newsystem.service.impl.TGoodService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用户对新闻的点赞 前端控制器
 * </p>
 *
 * @author chenlitao
 * @since 2022-11-06
 */
@RestController
@RequestMapping("/tgood")
@RequiredArgsConstructor
public class TGoodController {

    private final TGoodService tGoodService;
    private final TGoodMapper tGoodMapper;

    @ApiOperation("用户给新闻点赞或者取消点赞")
    @PostMapping("/addgood")
    public CommonResult<Object> addGood(String userId,String newsId){
        return tGoodService.insertGood(userId,newsId);
    }

}

